<?php
/*
 * Created on Sep 13, 2010
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
include_once("./configure/configure.php");		//--> global var
include_once("./configure/page.php");			//--> page configure
include_once("Smarty.class.php");				//--> out template
include_once("Common.php");
include_once("Access.php");					//--> Access class
include_once("UploadFiles.php");				//--> UploadFiles
include_once("Strings.php");					//--> String utils

include_once("orders/Cart.php");					//--> Cart
include_once("orders/CartProduct.php");				//--> Cart
include_once("orders/CartProductAttribute.php");	//--> Cart



if ($_SERVER["HTTPS"] <> "on")   
{   
	$xredir="https://".$_SERVER["SERVER_NAME"]. $_SERVER["REQUEST_URI"];   
	header("Location: ".$xredir);   
}    

$common 		= new Common();
$access 		= new Access();		//--> Access
$objStrings 	= new Strings();

$objCart 		= new Cart();		//--> Cart

session_start();

// write access log
$access->add(DB_TAG_SYSTEM, PAGE_ID_INDEX);

if($_SESSION['cart'])
	$objCart = unserialize($_SESSION['cart']);

/*----- out html -----*/
$smarty = new Smarty();	//-- out template
$smarty->template_dir 	= TEMPLATE_DIR;
$smarty->compile_dir  	= COMPILE_DIR;
$smarty->cache_dir  	= CACHE_DIR;

$smarty->debugging 		= false;
$smarty->caching 		= false;

$smarty->assign('HOME_URL', "..");
$smarty->assign('objCart', $objCart);
$smarty->assign('objStrings', $objStrings);

if(!$smarty->isCached('testHttps.html')){
	include_once('includeAll.php');

	$smarty->assign('categorys', $categorys);
	$smarty->assign('topCategory', $topCategory);
	$smarty->assign('bestsellers', $Bestsellers);
	$smarty->assign('new', $new);
}


$smarty->display('testHttps.html');
?>
